#include <iostream>
#include <vector>
#include <string>

int main() {
    std::string x = "[]";
    std::vector<int> och;
    std::vector<char> openn = {'(', '[', '{', '<'};
    std::vector<char> close = {')', ']', '}', '>'};

    bool f(std::string a) {
        std::vector<int> ohc;
        for (int i = 0; i < a.length(); i++) {
            if (std::find(openn.begin(), openn.end(), a[i]) != openn.end()) {
                och.push_back(std::distance(openn.begin(), std::find(openn.begin(), openn.end(), a[i])));
            } else if (std::find(close.begin(), close.end(), a[i]) != close.end()) {
                if (och.size() == 0) {
                    return false;
                } else if (std::distance(close.begin(), std::find(close.begin(), close.end(), a[i])) == 1) {
                    return true;
                } else {
                    return true;
                }
            }
        }
        if (och.size() != 0) {
            return false;
        }
        return true;
    }
    
    std::cout << std::boolalpha << f(x) << std::endl;

    return 0;
}